<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>snapol Code</title>


<style type="text/css">
<!--
input {
	color: #963;
}
-->
</style>
</head>

<body>

<script src="/api/jQuery/nicEdit.js" type="text/javascript"></script>
<script type="text/javascript">
     /*bkLib.onDomLoaded(function() {
          var myNicEditor = new nicEditor();
          myNicEditor.setPanel('myNicPanel');
          myNicEditor.addInstance('myInstance1');
          myNicEditor.addInstance('myInstance2');
          myNicEditor.addInstance('myInstance3');
     });*/
	 
	 

	 
	 
	 
	 
	 
	 
	 
</script>

<table width="97%" border="1" cellspacing="1" cellpadding="1">
  <tr>
    <td width="18%" valign="top"><p>Komponen</p>
      <p><a href="#" onclick="insertCom(); return false;">hinzufügen</a></p>
    <p>[data:snapol_component]<br />
      <a href="#" onclick="insertCom('[id]'); return false;">[titel]</a> [data_end]</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>Wizzard</p>
    <p>Formular einfügen</p></td>
    <td width="62%" valign="top"><p>
      <style type="text/css">
	#sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
	#sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
	#sortable li span { position: absolute; margin-left: -1.3em; }
	  </style>
      <script type="text/javascript">
	$(function() {
	
		
		
		$('#sortable').sortable({
   stop: function(event, ui) { 
   
   var result = $('#sortable').sortable('toArray');
   
   alert(result[0]);
   alert(result[1]);
   
   //alert('f');
   }
});
		
		
		
		
		
//		$("#sortable").disableSelection();
		
	});
	
	

	
	
	  </script>
      
      
      
      
      
      
      <style type="text/css">
	#feedback { font-size: 1.4em; }
	#sortable .ui-selecting { background: #FECA40; }
	#sortable .ui-selected { background: #F39814; color: white; }
	#sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
	#sortable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; }
	  </style>
	  <script type="text/javascript">
	/*$(function() {
		$("#sortable").selectable();
	})*/;
	  </script>

      
      
      
      
      </p>
      <p>Funktion Name <strong>[function.function]</strong> [function.id]</p>
<p>User Group ________________      </p>
      <p>[ajax:code]</p>
      <ul id="sortable"><p>[data:code,component::_function=[function.id]]
      </p>
      <p id="[id]">[titel] <a onclick="showWindow('/snapol/php/visual_property.php?code=[code.id]'); return false;" href="#">edit</a> <a href="delete.snap?table=code&amp;id2=[code.id2]">löschen</a><br />
        [html]    </p>
          [data_end]
      </ul>
    <p>[ajax_end]</p>
    <p>&nbsp;</p>
    <p>[com:editor:]</p>
    <p>&nbsp;</p>    <p>
      <label></label>
    </p></td>
    <td width="20%" valign="top"><p><strong>Funktionen</strong></p>
      <p>[data:function]<br />
        <a href="?function_id2=[id2]">[function]</a> <a href="/snapol/call/code.php?function=[id]">run</a> <a href="/snapol/call/html.php?function=[id]">view</a>[data_end] </p>
    <p>[form:function]</p>
    <p>[input:function] [button:save]</p>
    <p>[form_end]</p></td>
  </tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>


<script type="text/javascript">
    
	 
	 
	 function insertCom(id) {
		 
		 
		 //url = "/snapol/call/sqlQuery.php?sql=SELECT html text FROM snapol2_app_page WHERE id = "+ id;
		 url = "sqlQuery.snap?sql=SELECT html text FROM component WHERE id = "+ id;


$.get(url, function(data){

	//alert("Data Loaded: " + data);
	
	 //alert(html);
	 
	
	 saveData("code", "_function=[function.id]&_component="+id, "code", "function_id2=[function.id2]");
	 
		 
		//test = "<p>hello world</p>";
	//	document.getElementById('sortable').innerHTML=document.getElementById('sortable').innerHTML+data; 
//		document.getElementById('sortable').innerHTMLl=test; 
		 //alert(test);
	
	
	//document.getElementById('saveVideo').innerHTML = "Gespeichert";
	//document.getElementById(div).innerHTML = divContent;
//	getData('showAdress');

	
	//insertText(data);


});
		 
		 
		 
		
	 }
	 
	 
	 
	 
	 
	 
	 
</script>
